Repository navigation
feat: Codex /responses support + web search (WebIQ) + tool-call recovery fix - #4
Merged
Merged
Conversation
… Web IQ A third-party gateway can't fulfil Anthropic's server-side web tools, so the gateway dropped them and Claude Code lost web access. Now the inbound translator converts web_search/web_fetch to function tools, and a capped agentic loop in the Anthropic endpoint runs them internally against Microsoft Web IQ, feeding results back — the client only ever sees the final grounded answer (transparent). A new /web-search-support command stores the WebIQ key (data dir or WEBIQ_API_KEY, read lazily). Invariant enforced + tested in both stream and non-stream paths: a gateway tool never reaches the client (it has no handler and would stall), including on a mixed gateway+client turn and on loop-cap exhaustion. Verified live end-to-end (real Copilot + real WebIQ): a web_search request returns stop_reason=end_turn with a fresh answer and no tool_use leaked to the client. Co-Authored-By: Claude <noreply@anthropic.com>
Show a status overview on startup (GitHub login state, web search readiness, worker, configured clients) and a live web ✓/✗ marker in the HUD footer, which is now two lines so it doesn't crowd. GitHub shows a login STATE (connected/expired/signed-out) rather than an expiry — the device-flow OAuth token has no real expiry, so a countdown would be fake data. When web search isn't configured the indicator and card both point to /web-search-support. Co-Authored-By: Claude <noreply@anthropic.com>
Make /status render the same overview card as startup (GitHub login state via a live token-exchange check, web search readiness, worker, configured clients) followed by the worker restart history, instead of a plain worker-state line. Falls back to the registry's text /status when the App has no status props wired (keeps tests/headless paths working). Co-Authored-By: Claude <noreply@anthropic.com>
New Codex removed wire_api="chat" (codex#7782) and requires "responses",
which makes it POST {base_url}/responses — an endpoint we didn't serve,
so Codex failed to start. Add POST /openai/responses with a full
Responses translator (item-centric request → canonical, canonical →
response object, and a stateful SSE emitter carrying sequence_number and
the response.created → output_item.added → content_part.added →
output_text.delta → … → response.completed sequence). Flip the Codex
config to wire_api="responses" (base_url stays …/openai; Codex appends
/responses, no /v1).
Verified live against real Copilot: non-stream returns a completed
response object; stream begins response.created and ends
response.completed.
Co-Authored-By: Claude <noreply@anthropic.com>
…login Codex was still prompting for OpenAI login because our custom provider block had no auth field — Codex then defaults to the OpenAI login flow. Per the Codex config reference a custom provider needs an API key source. env_key is unreliable here (a standalone Codex CLI won't see our .env), so inline a static experimental_bearer_token plus requires_openai_auth = false. The worker ignores the key value; it just satisfies Codex's auth requirement and pins it to our local proxy. Co-Authored-By: Claude <noreply@anthropic.com>
config.toml was assembled by appending model/model_provider at the END of the file — after the user's existing [windows]/[marketplaces] tables. In TOML a bare key after a [table] header belongs to that table, so model_provider got silently nested under the last table and Codex never saw it, falling back to provider "openai" (hence the login prompt). Rewrite the assembler to split existing content into top-level keys vs. table blocks and emit ALL top-level keys first, then tables, then our provider table. Also de-dupe managed keys a previous buggy write left in the table region. Verified live: Codex now shows provider: copilot-reverse and connects to the local worker. Co-Authored-By: Claude <noreply@anthropic.com>
The /setup-codex card showed "wrote …/codex.env" — a legacy .env file the standalone Codex CLI doesn't read — which looked like the config was written to the wrong place. Both files are still written, but return the ~/.codex/config.toml result (the native config Codex actually reads) so the card surfaces the path and keys that matter. Co-Authored-By: Claude <noreply@anthropic.com>
Reads supported_endpoints from Copilot's /models so the adapter can route
each model to the right upstream — newer gpt-5.x models are /responses-
only and reject /chat/completions. First piece of the adapter
upstream-/responses work (gpt-5.5 via Codex). Returns {} on failure so
callers fall back to chat/completions.
Co-Authored-By: Claude <noreply@anthropic.com>
4 tasks
wangcansunking
added a commit
that referenced
this pull request
Jun 26, 2026
The original changeset was consumed by the partial v0.3.0 release (which shipped only PR #4's first commit); its changelog text is stale. This fresh changeset describes the full set of changes landing in this PR. Co-Authored-By: Claude <noreply@anthropic.com>
wangcansunking
added a commit
that referenced
this pull request
Jun 29, 2026
…plate, config, banner (#15) * feat(tui): scope+model status, chat-setup confirmation, parity, report template, config, banner - #6 /status + HUD show each client's scope AND pinned model, not a bare check - #5 chat setup_claude/codex require scope+model (ask first, never assume) - #7 add recent_errors + metrics chat tools to match slash commands - #4 /report body follows the #5 template (Summary/Environment/Repro) - #3 GitHub heartbeat interval/delay now configurable via AppConfig - #1 versioned "what's new" banner, shown ~3 launches then suppressed - #2 README reflects guards, runaway reporting, scope+model, config knobs Co-Authored-By: Claude <noreply@anthropic.com> * feat(report): add #5-style issue template; banner = major changes only - .github/ISSUE_TEMPLATE/bug.yml (Summary/Environment/Repro/Diagnostics/fixes) so manual issues match the rich #5 shape; /report still auto-fills the same sections. - what's-new banner trimmed to major changes only (the freeze fix); minor polish dropped. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch grew well beyond the original WebIQ change. It now covers three threads:
wire_api="chat") connects again, with per-model endpoint routing.web_search.<invoke>split across stream chunks leaked as literal text.Codex
/responsesresponses-inbound.tsinbound,responses-upstream.tsoutbound): item-centric request ↔ canonical, response object, and a stateful SSE emitter withsequence_number.POST /openai/responsesendpoint + Codex config writeswire_api="responses".fetchModelEndpointsreads each model'ssupported_endpoints; the adapter routes responses-only models (gpt-5.5, gpt-5.3-codex, …) to/responses, with a/chat400 →/responsessafety-net.web_searchhosted tool is passed through to Copilot (newCanonicalRequest.hostedTools) and runs server-side with citations.Web search backends
/webiq(get one at https://webiq.microsoft.ai/profiles/);/webiq cleanclears it. With no key, the tools return a message pointing to/webiqinstead of failing silently.COPILOT_WEB_SEARCH_ENABLED, but is off because gpt-5-mini is currently badly congested on Copilot's/responses(measured 20s–7min stalls /503s) while WebIQ is sub-second. Re-enabling is a one-flag flip.resolveWebSearchBackend(mode, hasKey)centralises the policy (copilot | webiq | unavailable).borrowSearchruns atreasoning.effort:"low"(~5-6× faster) and has a 30s timeout (the missing timeout was why a stalled search hung a whole turn for minutes)./web-search-supportcommand. Status card + HUD show the resolved backend (incl. an unavailable state).Invariant (unchanged, still enforced)
A gateway tool must never reach the client — Claude Code has no handler for
web_searchand would stall. Enforced and tested in both stream and non-stream paths, including a mixed gateway+client turn and loop-cap exhaustion.Tool-call recovery fix
ToolCallExtractor's split-sentinel hold-back listed only the bare<invoke/<function_calls>forms (the two namespaced slots were duplicate bare copies). Copilot streams Claude'santml:-namespaced tool call token-by-token, so an opening<invokesplit across chunks leaked as text and the whole call rendered literally. Fixed + split-at-every-offset regression tests.Verification
npm test→ 356 passed (55 files);npm run test:e2e→ 31 passed;tscbuild clean.web_searchvia WebIQ →stop_reason=end_turn, grounded answer, notool_useleak./webiqguidance message./responses; nativeweb_searchreturns citations.Test plan
codex execagainst a responses-only model (gpt-5.5) runs end-to-end./webiqsets a key;/webiq cleanclears it; status card + HUD reflect the backend.Changeset:
minor.🤖 Generated with Claude Code